home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / CIncludes / ToolUtils.h < prev    next >
C/C++ Source or Header  |  1996-05-01  |  3KB  |  148 lines

  1. /*
  2.      File:        ToolUtils.h
  3.  
  4.      Contains:    Toolbox Utilities Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. */
  18. #ifndef __TOOLUTILS__
  19. #define __TOOLUTILS__
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24. #ifndef __OSUTILS__
  25. #include <OSUtils.h>
  26. #endif
  27. #if OLDROUTINELOCATIONS
  28. #ifndef __FIXMATH__
  29. #include <FixMath.h>
  30. #endif
  31. #ifndef __ICONS__
  32. #include <Icons.h>
  33. #endif
  34. #ifndef __QUICKDRAW__
  35. #include <Quickdraw.h>
  36. #endif
  37. #ifndef __TEXTUTILS__
  38. #include <TextUtils.h>
  39. #endif
  40. /* !OLDROUTINELOCATIONS*/
  41. #endif
  42.  
  43. #ifdef __cplusplus
  44. extern "C" {
  45. #endif
  46.  
  47. #if PRAGMA_IMPORT_SUPPORTED
  48. #pragma import on
  49. #endif
  50.  
  51. #if PRAGMA_ALIGN_SUPPORTED
  52. #pragma options align=mac68k
  53. #endif
  54.  
  55. /*
  56. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  57.     Note: 
  58.     
  59.     The following routines that used to be in this header file, have moved to
  60.     more appropriate headers.  If OLDROUTINELOCATIONS is 0, then you will have
  61.     to include the headers below to use the following functions.
  62.     
  63.         FixMath.h:        FixMul
  64.                         FixRatio
  65.                         FixRound
  66.         
  67.         Icons.h:          GetIcon
  68.                         PlotIcon
  69.                         
  70.         Quickdraw.h:    AngleFromSlope
  71.                         DeltaPoint
  72.                         GetCursor
  73.                         GetIndPattern
  74.                         GetPattern
  75.                         GetPicture
  76.                         PackBits
  77.                         ScreenRes
  78.                         ShieldCursor
  79.                         SlopeFromAngle
  80.                         UnpackBits
  81.                         
  82.         TextUtils.h:    Munger
  83.                         GetIndString
  84.                         GetString
  85.                         NewString
  86.                         SetString
  87. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  88. */
  89.  
  90. /*    Used only in the LongMul function.*/
  91. struct Int64Bit {
  92.     SInt32                             hiLong;
  93.     UInt32                             loLong;
  94. };
  95. typedef struct Int64Bit Int64Bit;
  96.  
  97. #if FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE
  98. extern pascal Boolean BitTst(const void *bytePtr, long bitNum)
  99.  ONEWORDINLINE(0xA85D);
  100.  
  101. extern pascal void BitSet(void *bytePtr, long bitNum)
  102.  ONEWORDINLINE(0xA85E);
  103.  
  104. extern pascal void BitClr(void *bytePtr, long bitNum)
  105.  ONEWORDINLINE(0xA85F);
  106.  
  107. extern pascal long BitAnd(long value1, long value2)
  108.  ONEWORDINLINE(0xA858);
  109.  
  110. extern pascal long BitOr(long value1, long value2)
  111.  ONEWORDINLINE(0xA85B);
  112.  
  113. extern pascal long BitXor(long value1, long value2)
  114.  ONEWORDINLINE(0xA859);
  115.  
  116. extern pascal long BitNot(long value)
  117.  ONEWORDINLINE(0xA85A);
  118.  
  119. extern pascal long BitShift(long value, short count)
  120.  ONEWORDINLINE(0xA85C);
  121.  
  122. #if GENERATING68K
  123. extern pascal void LongMul(long a, long b, Int64Bit *result)
  124.  ONEWORDINLINE(0xA867);
  125.  
  126. #endif
  127. #endif
  128. #if !GENERATING68K
  129.     #define LongMul(a, b, result) ((void) WideMultiply((a), (b), (wide*)(result)))
  130. #endif
  131. #define HiWord(x) ((short)((long)(x) >> 16))
  132. #define LoWord(x) ((short)(x))
  133.  
  134. #if PRAGMA_ALIGN_SUPPORTED
  135. #pragma options align=reset
  136. #endif
  137.  
  138. #if PRAGMA_IMPORT_SUPPORTED
  139. #pragma import off
  140. #endif
  141.  
  142. #ifdef __cplusplus
  143. }
  144. #endif
  145.  
  146. #endif /* __TOOLUTILS__ */
  147.  
  148.